package kr.or.javacafe.USCM.USCM303.web;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import kr.or.javacafe.USCM.USCM303.service.USCM303Service;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

public class USCM303Controller extends MultiActionController {
	protected final static Log logger = LogFactory.getLog(USCM303Controller.class);
	
	private USCM303Service uscm303Service;
	
	public void setUscm303Service(USCM303Service uscm303Service){
		this.uscm303Service = uscm303Service;
	}
	

	
	public ModelAndView uscm303Main(HttpServletRequest request, HttpServletResponse response) throws Exception
	{
		logger.debug("uscm303Main");
		List objList = uscm303Service.findBoardList();
		
		ModelAndView returnPage = new ModelAndView("USCM303/uscm303Main");
		returnPage.addObject("objList",objList);
		
		return returnPage;
	}
	public ModelAndView findBoardList(HttpServletRequest request, HttpServletResponse response) throws Exception
	{
		if (logger.isDebugEnabled()){ logger.debug("Entering " + getClass() + "." + "ajax_path_normal()"); }
		
		List objList = uscm303Service.findBoardList();
		
		ModelAndView returnPage = new ModelAndView("JSON", "JSON_DATA", objList);	
		returnPage.addObject("objList", objList);
		
		return returnPage;
	}	
		

}
